
<%@ page import="report.Plan" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <title>iPET - Planejamento</title>
    </head>
    <body>
        <g:render template="/common/menuPlan" />
        <div id="text">
        <div class="body">
            <h2>Informações do planejamento</h2>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="dialog">
                <table>
                    <tbody>
                        <tr class="prop">
                            <td valign="top" class="name"><g:message code="plan.year.label" default="Ano" /></td>
                            <td valign="top" class="value">${planInstance?.year}</td>
                        </tr>
                        <tr class="prop">
                            <td valign="top" class="name"><g:message code="plan.activities.label" default="Atividades" /></td>
                            <td class="value list">
                                <ul>
                                <g:each in="${planInstance.activities}" var="activity">
                                    <li><g:link controller="activity" action="show" id="${activity?.id}">${activity?.nature}, ${activity?.theme}</g:link></li>
                                </g:each>
                                </ul>
                            </td>
                        </tr>
                        <tr class="prop">
                            <td valign="top" class="name"><g:message code="plan.observation.label" default="Observações" /></td>
                            <td valign="top" class="value">${fieldValue(bean: planInstance, field: "observation")}</td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="buttons">
                <g:form>
                    <g:hiddenField name="id" value="${planInstance?.id}" />
                    <span class="button"><g:actionSubmit class="edit" action="edit" value="Editar" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="Remover" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Tem certeza ?')}');" /></span>
	                <span class="button"><input type="submit" value="Gerar relatório" class="report" onclick="var f = document.createElement('form'); f.style.display = 'none'; f.method = 'POST'; f.action = '/iPET/pdf/plan'; var s = document.createElement('input'); s.setAttribute('type', 'hidden'); s.setAttribute('name', 'id'); s.setAttribute('value', '${planInstance?.id}'); f.appendChild(s); f.submit(); return false;"></span>
                </g:form>
            </div>
        </div>
        </div>
    </body>
</html>
